function myinstanceof(l, r) {
  while (l.__proto__ !== null) {
    l = l.__proto__
    if (l === r.prototype) {
      return true
    }
  }
  return false


  // if (l === null || typeof l !== 'object') return false
  // if (l.__proto__ === r.prototype) return true
  // return myinstanceof(l.__proto__, r)
  
  
}

console.log(myinstanceof([], Object))